<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<meta charset="UTF-8">
		<title>教师主页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
	    <meta name="author" content="GeeksLabs">
	    <meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
	    <link rel="shortcut icon" href="img/favicon.png">
	
	    
	</head>
	<body>
		
      	<c:import url="tea_home.jsp"></c:import>
      	
      	<!-- 新增学生模态框 -->
     	<!-- 
		<div class="modal fade bs-example-modal-lg" id="addStuModel" tabindex="-1" role="dialog" aria-labelledby="addStuModalLabel">
		  <div class="modal-dialog" style="margin-right: 1000px" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="addStuModalLabel">新增学生</h4>
		      </div>
		      <div class="modal-body">
		        <form class="form-horizontal">
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">学号</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="stuId" name="stuId" placeholder="正确输入学号">
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">姓名</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="stuName" name="stuName" placeholder="输入学生姓名">
				    <span id="helpBlock2" class="help-block"></span>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">性别</label>
				    <div class="col-sm-5">
				      <label class="radio-inline">
						  <input type="radio" name="stuSex" id="stuSex" value="男" checked="checked">男
						</label>
						<label class="radio-inline">
						  <input type="radio" name="stuSex" id="stuSex" value="女">女
						</label>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">年级</label>
				    <div class="col-sm-5">
				      <select class="form-control" name="stuGrade" id="stuGrade">
						  
						  <option value="1">大一</option>
						  <option value="2">大二</option>
						  <option value="3">大三</option>
						  <option value="4">大四</option>
						</select>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">班级</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="stuClass" name="stuClass" placeholder="输入班级">
				    <span id="helpBlock2" class="help-block"></span>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">邮箱</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="stuEmail" name="stuEmail" placeholder="输入学生Email">
				    	<span id="helpBlock2" class="help-block"></span>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">联系方式</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="stuTell" name="stuTell" placeholder="输入联系方式">
				    	<span id="helpBlock2" class="help-block"></span>
				    </div>
				  </div>
				</form>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		        <button type="button" class="btn btn-primary" id="addStu_btn">保存</button>
		      </div>
		    </div> 
		  </div>
		</div>
		-->
      	<!-- 新增任务模态框 -->
     	<!-- Modal -->
		<div class="modal fade bs-example-modal-lg" id="empAddModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		  <div class="modal-dialog" style="margin-right: 1000px" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="myModalLabel">新增任务</h4>
		      </div>
		      <div class="modal-body">
		        <form class="form-horizontal" id="creatTask_form">
		        	<input type="hidden" id="creatTask_form_projectId" name="projectId" value="${projectInfo.project.projectId }"/>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">任务名称:</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="creatTask_form_taskName" name="taskName" placeholder="输入新增任务名称">
				    </div>
				  </div>
				  <div class="form-group">
				  	<label  class="col-sm-3 control-label">gitee分支:</label>
				    <div class="col-sm-5">
				      <input type="text" class="form-control" id="creatTask_form_branch" name="branch" placeholder="该任务代码提交的分支">
				    </div>
				  </div>
				 <div class="layui-form form-group">
			
				    <label class="col-sm-3 control-label">选择学生:</label>
					 <div class="col-sm-9" style="height: 20px">
						<input type="checkbox" id="check_null" name="check_null" title="暂不分配" lay-skin="primary" value="0" checked>
						<c:forEach items="${projectInfo.members}" var="member" varStatus="status">
							<input type="checkbox" name="check_stuId" title="${member.stuName}" lay-skin="primary" value="${member.stuId}">
						</c:forEach>
					</div>
				 </div>
				  
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">任务介绍:</label>
				    <div class="col-sm-9">
				      <textarea id="creatTask_form_task_introduction" name="task_introduction" class="form-control" rows="3" placeholder="请介绍任务..."></textarea>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  class="col-sm-3 control-label">任务说明书:</label>
				    <div class="col-sm-9" id="div_upload_taskFile">
				    	<div class="row">
				    		<button type="button" class="layui-btn layui-btn-normal" id="chooseFile7" value="7">选择文件</button>
							&nbsp;<button type="button" class="layui-btn" id="upload7">上传</button>
				    	</div>    		
					</div>
					
				  </div>
				</form>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		        <button type="button" class="btn btn-primary" id="saveTask_btn">保存</button>
		      </div>
		    </div>
		  </div>
		</div>
      	
      	<div class="layui-body container">
      		
			<div class="layui-row">
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 100px;">
				  <legend>项目中期检查</legend>
				  <c:if test="${middleCheck==null}">
				  	暂无
				  </c:if>
				  <c:if test="${middleCheck!=null}">
				  	<form class="form-horizontal col-sm-8 col-md-offset-1">
						<div class="form-group">
							<label class="col-sm-4 control-label">检查时间:</label>
							<div class="col-sm-8">
								<p class="form-control-static">${middleCheck.check_time}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">检查地点:</label>
							<div class="col-sm-8">
								<p class="form-control-static">${middleCheck.check_address}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">检查要求:</label>
							<div class="col-sm-8">
								<p class="form-control-static">${middleCheck.check_require}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-4 control-label">状态:</label>
							<div class="col-sm-8">
								<p class="form-control-static">
								<c:if test="${middleCheck.check_status==0}">待检查</c:if>
								<c:if test="${middleCheck.check_status==1}">检查通过</c:if>
								<c:if test="${middleCheck.check_status==2}">检查失败</c:if>
								</p>
							</div>
						</div>
					</form>
				  </c:if>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 80px;">
				  <legend>项目进度</legend>
				
				<div class="layui-col-md-offset1 layui-col-md10">
				<div class="panel-body">
					<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
					  <ul class="layui-tab-title">
					    <li class="layui-this">项目信息</li>
					    <li>申报项目</li>
					    <li>提交需求分析</li>
					    <li>编码阶段</li>
					    <li>软件测试</li>
					    <li>项目延期申请</li>
					    <li>申请验收</li>
					  </ul>
					  <div class="layui-tab-content">
					  
					  	<!-- 项目信息 -->
					    <div class="layui-tab-item layui-show">
					    	<c:if test="${applyProject==null and projectInfo==null}">
					    		<input type="hidden" id="ps" name="ps" value="0">
					    		<h1>您目前暂无项目，可申报项目</h1>
					    	</c:if>
					    	<c:if test="${applyProject!=null and projectInfo==null}">
					    		<input type="hidden" id="ps" name="ps" value="1">
					    		<form class="form-horizontal">
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目编号:</label>
								    <div class="col-sm-5">
								      <p class="form-control-static">${applyProject.projectId}</p>
								      <input type="hidden" name="1_projectId" id="1_projectId" value="${applyProject.projectId}"/>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目名称:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								      ${applyProject.projectName}</p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">成员数量:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								      ${applyProject.memberNum}</p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目状态:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static" ><mark>
								      	<input type="hidden" id="1_projectStatus" name="1_projectStatus" value="${applyProject.projectStatus}">
								      	<c:if test="${applyProject.projectStatus==0}">待定</c:if>
								      	<c:if test="${applyProject.projectStatus==1}">审核通过</c:if>
								      	<c:if test="${applyProject.projectStatus==2}">驳回</c:if>
								      	<c:if test="${applyProject.projectStatus==3}">已完成</c:if>
								      </mark></p>
								    </div>
								  </div>
								  <c:if test="${applyProject.projectStatus==2}">
								  	<div class="form-group">
									    <label class="col-sm-2 control-label">驳回原因:</label>
									    <div class="col-sm-10">
									      <p class="form-control-static">${applyProject.fail_reason}</p>
									    </div>
									  </div>
								  </c:if>
								 <div class="form-group">
								    <label class="col-sm-2 control-label">项目组长:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								      	${teacher.teaName}
								     </p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目申报时间:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">${applyProject.applyTime}</p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目描述:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">${applyProject.projectInfo}</p>
								    </div>
								  </div>
								  <div class="from-group">
										<div class="col-sm-2" style="margin-left: 300px">
											<button type="button" class="btn btn-info btn-block"
												onclick="javascript:history.go(-1);">
												<i class="clip-arrow-right-2 "></i> 返回
											</button>
										</div>
									</div>
								</form>
					    	</c:if>
					    	<c:if test="${applyProject==null and projectInfo!=null}">
					    		<input type="hidden" id="ps" name="ps" value="2">
					    		<form class="form-horizontal">
					    			<input type="hidden" id="app_memberNum" value="${projectInfo.applyProject.memberNum}">
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目编号:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static">${projectInfo.project.projectId}</p>
								    	<input type="hidden" name="1_projectId" id="1_projectId" value=" ${projectInfo.project.projectId}"/>
								    </div>
								    
								    <label class="col-sm-2 control-label">项目名称:</label>
								    <div class="col-sm-3">
								      <p class="form-control-static">
								      ${projectInfo.project.projectName}</p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目状态:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static"><mark>
								      	<input type="hidden" id="1_projectStatus" name="1_projectStatus" value="${projectInfo.project.projectStatus}">
								      	<c:if test="${checkProject!=null}">
								      		<c:if test="${checkProject.applyStatus==0 }">申请验收</c:if>
								      		<c:if test="${checkProject.applyStatus==1 }">等待验收</c:if>
								      		<c:if test="${checkProject.applyStatus==2 }">验收完成</c:if>
								      	</c:if>
								      	<c:if test="${checkProject==null}">
								      	<c:if test="${projectInfo.project.projectStatus==0}">验收完成</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==1}">申报成功</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==2}">已提交需求分析</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==3}">开始编码</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==4}">编码完成20%</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==5}">编码完成40%</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==6}">编码完成60%</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==7}">编码完成80%</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==8}">已完成编码</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==9}">测试阶段</c:if>
								      	<c:if test="${projectInfo.project.projectStatus==10}">申请验收</c:if>
								      	</c:if>
								      </mark></p>
								    </div>
								  </div>

								   <div class="form-group">
								    <label class="col-sm-2 control-label">项目组长:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static">
								      ${projectInfo.group.leaderName}
								     </p>
								    </div>
								    <label class="col-sm-2 control-label">分配房间:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static">
								      ${projectInfo.project.roomId}
								     </p>
								    </div>
								  </div>
								  
								  <div class="form-group">
								    <label class="col-sm-2 control-label">团队编号:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static">
								      ${projectInfo.group.groupId}
								     </p>
								     <input type="hidden" id="1_groupId" name="1_groupId" value="${projectInfo.group.groupId}">
								    </div>
								    <label class="col-sm-2 control-label">团队名称:</label>
								    <div class="col-sm-4">
								      <p class="form-control-static">
								      ${projectInfo.group.groupName}
								     </p>
								    </div>
								  </div>
								  
								  <c:if test="${projectInfo.project.memberNum!=0}">
								  	<div class="form-group">
								    <label class="col-sm-2 control-label">成员数目:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								      ${projectInfo.project.memberNum}
								     
								     </p>
								    </div>
								  </div>
								  </c:if>
								  <c:if test="${projectInfo.project.memberNum==0}">
								  	<div class="form-group">
								    <label class="col-sm-2 control-label">最多添加成员数目:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								       ${projectInfo.applyProject.memberNum}
								     </p>
								    </div>
								  </div>
								  </c:if>
								  
								  <div class="form-group">
								    <label class="col-sm-2 control-label">团队成员:</label>
								    <div class="col-sm-10">
								      <p class="form-control-static">
								      	<c:forEach items="${projectInfo.members}" var="member">
								      		${member.stuName}&nbsp;&nbsp;
								      	</c:forEach>
								     </p>
								    </div>
								  </div>
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目申报时间:</label>
								    <div class="col-sm-2">
								      <p class="form-control-static">
								      	<fmt:formatDate value="${projectInfo.project.createTime}" pattern="yyyy-MM-dd"/> 
								      </p>
								    </div>
								    <label class="col-sm-2 control-label">预计完成时间:</label>
								    <div class="col-sm-3">
								    	<c:if test="${projectInfo.project.update_finishTime eq null}">
								    		<p class="form-control-static">
								    			<fmt:formatDate value="${projectInfo.project.finishTime}" pattern="yyyy-MM-dd"/> 
								    		</p>
								    		<input type="hidden" id="finishTime" value="${projectInfo.project.finishTime}">
								    	</c:if>
								    	<c:if test="${projectInfo.project.update_finishTime ne null}">
								    		<p class="form-control-static">${projectInfo.project.update_finishTime}</p>
								    		<input type="hidden" id="finishTime" value="${projectInfo.project.update_finishTime}">
								    	</c:if>
								      
								    </div>
								  </div>
								  
								  <div class="form-group">
								    <label class="col-sm-2 control-label">项目描述:</label>
								    <div class="col-sm-8">
								      <p class="form-control-static">${projectInfo.project.projectInfo}</p>
								    </div>
								  </div>
								  <c:if test="${checkProject!=null}">
								  	<c:if test="${checkProject.applyStatus==2}">
									  <div class="form-group">
									    <label class="col-sm-2 control-label">评分:</label>
									    <div class="col-sm-2">
									      <p class="form-control-static">${checkProject.pro_rate}</p>
									    </div>
									  </div>
									  
									  <div class="form-group">
									    <label class="col-sm-2 control-label">评语:</label>
									    <div class="col-sm-8">
									      <p class="form-control-static" >${checkProject.pro_comment}</p>
									    </div>
									  </div>
								  		</c:if>
								  	<c:if test="${checkProject.applyStatus==3}">
								  		<div class="form-group">
									    <label class="col-sm-2 control-label">驳回原因:</label>
									    <div class="col-sm-2">
									      <p class="form-control-static" >${checkProject.failCheckInfo}</p>
									    </div>
									  </div>
								  	</c:if>
								  </c:if>
								  <div class="from-group">
										<div class="col-sm-2" style="margin-left: 300px">
											<button type="button" class="btn btn-info btn-block"
												onclick="javascript:history.go(-1);">
												<i class="clip-arrow-right-2 "></i> 返回
											</button>
										</div>
									</div>
								</form>
					    	</c:if>		
						</div>
						<!-- 项目申报 -->
					    <div class="layui-tab-item">
					    <c:choose>
					    	<c:when test="${applyProject!=null and applyProject.projectStatus==0}">
					    		<div class="panel panel-default">
						    	<div class="panel-heading">
								    <h3 class="panel-title">
								    ${applyProject.projectName}
								    </h3>
								  </div>
								 <div class="panel-body">
								 	<label class="col-sm-8 control-label">项目申报中,请等待..
								 	<i class="layui-icon" style="font-size: 40px; color: #00CD00;">&#xe63d;</i> 
								 	</label>
								 </div>
								 </div>
					    	</c:when>
					    	<c:when test="${projectInfo!=null and projectInfo.project.projectStatus!=0}">
					    		<div class="panel panel-default">
					    		<div class="panel-heading">
								    <h3 class="panel-title">
								    ${projectInfo.project.projectName}
								    </h3>
								  </div>
								 <div class="panel-body">
								 	<label class="col-sm-8 control-label">项目申报成功,进行后续操作.</label>
								 </div>
								 </div>
					    	</c:when>
					    	<c:otherwise>
					    		<div class="panel panel-default">
					    
								  <div class="panel-heading">
								    <h3 class="panel-title">提交项目基本信息:</h3>
								  </div>
								<div class="panel-body">
						    	<form class="layui-form layui-form-pane" action="#" id="creatProject">
						    		<input type="hidden" id="creatProject_declareReport" name="declareReport">
								  <div class="layui-form-item">
								    <label class="layui-form-label">项目名称</label>
								    <div class="layui-input-inline">
								      <input type="text" id="creatProject_projectName" name="projectName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
								    </div>
								  </div>
								  <div class="layui-form-item">
								    <label class="layui-form-label">成员数量</label>
								    <div class="layui-input-inline">
								      <select name="memberNum" lay-verify="">
										  <option value="">选择成员数量</option>
										  <option value="1">1</option>
										  <option value="2">2</option>
										  <option value="3">3</option>
										  <option value="4">4</option>
										  <option value="5">5</option>
										</select>    
								    </div>
								  </div>
								  <div class="layui-form-item">
								    <div class="layui-inline">
								      <label class="layui-form-label">完成时间</label>
								      <div class="layui-input-block">
								        <input type="text" name="finishTime" id="the_date" autocomplete="off" class="layui-input">
								      </div>
								    </div>
								  </div>
								   
								  <div class="layui-form-item">
								  	<div class="layui-inline">
								    	<label class="layui-form-label">项目申报书</label>
								    </div>
								      <button type="button" class="layui-btn layui-btn-normal" id="chooseFile" value="4">选择文件</button>
								  </div>
								  
								  <div class="layui-form-item">
								    <div class="layui-inline">
								      <label class="layui-form-label">项目描述：</label>
								    </div>
								    <textarea id="creatProject_projectInfo" name="projectInfo" class="form-control" rows="3" placeholder="请介绍项目..."></textarea>
								  </div>
								  <div class="row">
								  	<div class="col-md-2">
								  		<button type="button" class="layui-btn" id="submit_createPro">提交</button>
								  	</div>
								  </div> 
								</form>
								</div>
								</div>
								<!--
								<div class="panel panel-default" id="upload_panel">
								  <div class="panel-heading">
								    <h3 class="panel-title">上传项目申报书:</h3>
								  </div>
								  <div class="panel-body" id="upload_ok">	  
								    <div class="row">	
									    <div class="col-md-8">
									    	<button type="button" class="layui-btn layui-btn-normal" id="chooseFile" value="4">选择文件</button>
											<button type="button" class="layui-btn" id="upload">上传</button>
									    </div>   
								  </div>
								</div>
								</div>
								  -->
					    	</c:otherwise>
					    </c:choose>
					    
					    
					    </div>
					    <!-- 提交需求分析  -->
					    <div class="layui-tab-item">	    	
					    	<div class="panel panel-default">
					    	<c:choose>
							  	<c:when test="${projectInfo==null}">
							  		<div class="panel-heading">
									    <h3 class="panel-title">
									    	<c:if test="${applyProject==null}">
									    		无项目
									    	</c:if>
									    	<c:if test="${applyProject!=null}">
									    		${applyProject.projectName}
									    	</c:if>
									    </h3>
									  </div>
									  <div class="panel-body">
							  			<label class="col-sm-5 control-label">未获取权限,请先完成前面的操作.</label>
							  		</div>
							  	</c:when>
							  	<c:when test="${projectInfo.project.projectStatus==0}">
							  		<div class="panel-heading">
									    <h3 class="panel-title">
									    	${projectInfo.project.projectName}
									    </h3>
									  </div>
									  <div class="panel-body">
							  		<label class="col-sm-5 control-label">验收完成</label>
							  		</div>
							  	</c:when>
							  	<c:when test="${projectInfo.project.projectStatus>=2}">
							  		<div class="panel-heading">
									    <h3 class="panel-title">
									    	${projectInfo.project.projectName}
									    </h3>
									  </div>
									  <div class="panel-body">
							  			<label class="col-sm-5 control-label">需求分析已提交</label>
							  		</div>
							  	</c:when>
							  	<c:otherwise>
							  		<div class="panel-heading">
									    <h3 class="panel-title">${projectInfo.project.projectName}</h3>
									  </div>
									  <div class="panel-body">
									  
									  	<form class="form-horizontal">
										  	<div class="form-group">
											    <label class="col-sm-2 control-label" style="margin-top: 10px">需求分析报告:</label>
											    <div class="col-sm-8">
											      <p class="form-control-static">
											      	<button type="button" class="layui-btn layui-btn-normal1" id="chooseFile1" value="5">选择文件</button>
													</p>
											    </div>
											</div>
											<div class="form-group">
											    <label for="inputEmail3" class="col-sm-2 control-label">Gitee项目名称:</label>
											    <div class="col-sm-3">
											      <input type="text" class="form-control" id="gitee_proName" name="gitee_proName" placeholder="在Gitee上创建的项目名称">
											      <input type="hidden" id="gitee_full_name">
											    </div>
											 </div>
											 <div class="form-group">
											    <label for="inputEmail3" class="col-sm-2 control-label">团队名称:</label>
											    <div class="col-sm-3">
											      <input type="text" class="form-control" id="add_groupName" name="add_groupName" placeholder="请输入...">
											    </div>
											  </div>
											<div class="form-group">
												<label class="col-sm-2 control-label" style="margin-top: 10px">添加项目成员:</label>
												<div class="col-sm-8">
												    <div class="input-group">
												      <input id="addStu_input" name="addStu_input" type="text" class="form-control" placeholder="输入要添加学生的学号">
												      <span class="input-group-btn">
												        <button class="btn btn-default" type="button" id="addStu_btn">添加</button>
												      </span>
												    </div><!-- /input-group -->
												  </div>
											</div>
										</form>
									  </div>
									  <ul class="list-group" id="memberList">
									    
									  </ul>
									  <div class="panel-footer">
									  	<button type="button" class="layui-btn" id="submitMembers">提交</button>
									  </div>
							  	</c:otherwise>
							  </c:choose>
							  
						</div>
					    	
					    </div>
					    <div class="layui-tab-item">
					   		<!-- 完成编码 -->
					   		<c:if test="${projectInfo==null}">
					   			未有申报通过的项目!
					   		</c:if>
					   		<c:if test="${projectInfo!=null}">
					   		<div class="panel panel-default">
							  <div class="panel-heading">
							    <h3 class="panel-title">${projectInfo.project.projectName}
							    	<c:if test="${tasks==null}">
							    		<small>&nbsp;&nbsp;<mark>未创建任务</mark></small>
							    	</c:if>
							    	<c:if test="${tasksStatus==tasks.size() and tasks.size()>0}">
							    		&nbsp;&nbsp;<mark>任务已全部完成</mark>
							    		<input type="hidden" id="tasksStatus" value="1">
							    	</c:if>
							    	<c:if test="${tasks!=null}">
							    		<small>&nbsp;&nbsp;已创建任务:<mark>${tasks.size()}</mark></small>
							    	</c:if>
							    	
							    </h3>
							  </div>
							  <div class="panel-body">
							  	<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
								  <ul class="layui-tab-title">
								  	<c:forEach items="${tasks}" var="map" varStatus="status">
								  		<c:if test="${status.index==0}">
								  			<li class="layui-this">${map.key.taskName}
								  		</c:if>
								  		<c:if test="${status.index!=0}">
								  			<li>${map.key.taskName}
								  		</c:if>
								  				
								  				<c:if test="${map.key.taskStatus==1}">
								  					<mark>待分配</mark>
								  				</c:if>
								  				<c:if test="${map.key.taskStatus==2}">
								  					
								  				</c:if>
								  				<c:if test="${map.key.taskStatus==3}">
								  					<mark>已完成</mark>
								  				</c:if>
								  	</c:forEach>								    
								  </ul>
								  <div class="layui-tab-content">
								  	<c:forEach items="${tasks}" var="map" varStatus="status">
								  		<c:if test="${status.index==0}">
								  			<div class="layui-tab-item layui-show">
								  		</c:if>
								  		<c:if test="${status.index!=0}">
								  			<div class="layui-tab-item">
								  		</c:if>
								  		<form class="form-horizontal">
										  <div class="form-group">
										    <label class="col-sm-2 control-label">任务名称:</label>
										    <div class="col-sm-10">
										      <p class="form-control-static">${map.key.taskName}</p>
										    </div>
										  </div>
										  <div class="form-group">
										    <label class="col-sm-2 control-label">任务负责人:</label>
										    <div class="col-sm-10">
										      <p class="form-control-static">
										      	
										      	<c:if test="${map.key.taskStatus==1}">
								  					未分配
								  				</c:if>
								  				<c:if test="${map.key.taskStatus!=1}">
								  					<c:forEach items="${map.value}" var="stu">
								  						${stu.stuName}(${stu.stuId})&nbsp;
								  					</c:forEach>
								  					
								  				</c:if>
										      </p>
										    </div>
										  </div>
										  <div class="form-group">
										    <label class="col-sm-2 control-label">任务状态:</label>
										    <div class="col-sm-10">
										      <p class="form-control-static">
										      	<c:if test="${map.key.taskStatus==0}">
								  					任务已删除
								  				</c:if>
												<c:if test="${map.key.taskStatus==1}">
								  					待分配
								  				</c:if>
								  				<c:if test="${map.key.taskStatus==2}">
								  					已分配
								  				</c:if>
								  				<c:if test="${map.key.taskStatus==3}">
								  					已完成
								  				</c:if>
												</p>
										    </div>
										  </div>
										  
										  <div class="form-group">
										    <label class="col-sm-2 control-label">gitee代码分支:</label>
										    <div class="col-sm-10">
										      <p class="form-control-static">
										      	<c:if test="${map.key.branch==null}">
										      		未设置
										      	</c:if>
										      	<c:if test="${map.key.branch!=null}">
										      		${map.key.branch}
										      	</c:if>
										      </p>
										     </div>
										  </div>
										      
										  <c:if test="${map.key.taskStatus==2}">
											  <div class="form-group">
											    <label class="col-sm-2 control-label">任务进度:</label>
											    <div class="col-sm-10">
											      <div class="progress" style="margin-top: 8px">
													  <div id="task_process" class="progress-bar" role="progressbar" aria-valuenow="${map.key.process}" aria-valuemin="0" aria-valuemax="100" style="width: ${map.key.process}%;">
													    ${map.key.process}%
													  </div> 
													</div>
											    </div>
											  </div>
											  
										  </c:if>
										  <c:if test="${map.key.taskStatus==3}">
										  	<div class="form-group">
											    <label class="col-sm-2 control-label">完成时间:</label>
											    <div class="col-sm-10">
											      <p class="form-control-static">${map.key.finishTime}</p>
											    </div>
											  </div>
										  </c:if>
										  <c:if test="${map.key.taskStatus==1}">
										  	<div class="form-group layui-form">
											    <label class="col-sm-2 control-label">选择学生:</label>
											    <div class="col-sm-10" style="height: 20px">
											    	<c:forEach items="${projectInfo.members}" var="member" varStatus="status">
															<input type="checkbox" name="check2_stuId" title="${member.stuName}" lay-skin="primary" value="${member.stuId}">			      		
											      	</c:forEach>
													<button type="button" class="btn btn-info" onclick="distributeTask('${map.key.taskId}')">分配</button>
											    </div>
											 </div>
										  </c:if>
										  <div class="form-group">
										    <label class="col-sm-2 control-label">任务说明书:</label>
										    <div class="col-sm-10">
										      <p class="form-control-static">
										      <a href="${pageContext.request.contextPath}/file/downloadProjectFile.do?fileId=${map.key.taskFile}">下载</a>
										      </p>
										    </div>
										  </div>
										  <div class="form-group">
										  	<label class="col-sm-2 control-label">任务说明:</label>
										    <textarea class="form-control col-sm-10" rows="4">
										    	${map.key.task_introduction}
										    </textarea> 
										  </div> 
										</form>
										</div>	
																	  		
								  	</c:forEach>  
								  	
								   </div>  
								</div>
							  <div class="panel-footer">
							  	<c:choose>
							  		<c:when test="${projectInfo.project.projectStatus<2}">
							  			请先提交需求分析.
							  		</c:when>
							  		<c:when test="${tasks==null}">
							  			<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#empAddModel" id="addTask_modal">
									 	 新增任务
									 	 </button>
							  		</c:when>
							  		<c:when test="${tasksStatus==tasks.size() and  tasks.size()!=0}">
							  		
							  		</c:when>
							  		<c:otherwise>
							  			<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#empAddModel" id="addTask_modal">
									 	 新增任务
									</button>
							  		</c:otherwise>
							  	</c:choose>
							  	
							  </div>
							</div>
							</c:if>
					   	</div>
					   	</div>
					    <div class="layui-tab-item">软件测试</div>
					    
					    <!-- 项目延期申请 -->
					    <div class="layui-tab-item">
					    	<div class="panel panel-default">
							  <div class="panel-heading">
							    <h3 class="panel-title">${projectInfo.project.projectName}</h3>
							  </div>
							<div class="panel-body">
								<c:if test="${checkProject!=null}">
									<label class="col-sm-8 control-label">已申请验收，不能修改完成时间.</label>
								</c:if>
								<c:if test="${checkProject==null}">
					    		<form class="form-horizontal">
									<div class="form-group">
										<label class="col-sm-2 control-label">项目申报时间:</label>
										<div class="col-sm-10">
											<p class="form-control-static">
											<fmt:formatDate value="${projectInfo.project.createTime}" pattern="yyyy-MM-dd"/>
											</p>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">预计完成时间:</label>
										<div class="col-sm-10">
											<c:if test="${projectInfo.project.update_finishTime==null}">
												<p class="form-control-static">
													<fmt:formatDate value="${projectInfo.project.finishTime}" pattern="yyyy-MM-dd"/>
												</p>
											</c:if>
											<c:if test="${projectInfo.project.update_finishTime!=null}">
												<p class="form-control-static">${projectInfo.project.update_finishTime}</p>
											</c:if>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">修改完成时间:</label>
										<div class="col-sm-10">
											<input type="text" name="update_finishTime" id="update_Finish_date" autocomplete="off" class="layui-input col-sm-3">
											<button type="button" class="layui-btn col-sm-2 col-sm-offset-1" id="submit_update_finishTime">提交申请</button>
										</div>
									</div>
									
								</form>
								</c:if>
							</div>
							</div>
					    </div>
					    <!-- 申请验收 -->
					    <div class="layui-tab-item">
					    	<div class="panel panel-default">
							  <div class="panel-heading">
							    <h3 class="panel-title">${projectInfo.project.projectName}</h3>
							  </div>
							<div class="panel-body">
								<!-- 未提交验收申请 -->
								<c:if test="${projectInfo==null}">
									请先完成申报项目!
								</c:if>
								<c:if test="${projectInfo.project.projectStatus>0 and projectInfo.project.projectStatus<=2}">
									没有已完成的项目!
								</c:if>
								<c:if test="${checkProject==null and projectInfo.project.projectStatus>2}">
									<form class="form-horizontal">
										<div class="form-group">
											<label class="col-sm-2 control-label">预计完成时间:</label>
											<div class="col-sm-10">
												<c:if test="${projectInfo.project.update_finishTime==null}">
													<p class="form-control-static">${projectInfo.project.finishTime}</p>
												</c:if>
												<c:if test="${projectInfo.project.update_finishTime!=null}">
													<p class="form-control-static">${projectInfo.project.update_finishTime}</p>
												</c:if>
											</div>
										</div>
										<div class="form-group">
										    <label  class="col-sm-2 control-label">项目报告:</label>
										    <div class="col-sm-10" id="div_upload_projectReport">
										    	<div class="row">
										    		<button type="button" class="layui-btn layui-btn-normal" id="chooseFile6" value="6">选择文件</button>
													&nbsp;<button type="button" class="layui-btn" id="upload6">提交申请</button>
										    	</div>									    		
											</div>	
										  </div>
									</form>
								</c:if>
								<!-- 已提交验收申请 -->
					    		<c:if test="${checkProject!=null}">
					    			<form class="form-horizontal">
										<div class="form-group">
											<label class="col-sm-2 control-label">状态:</label>
											<div class="col-sm-10">
												<c:if test="${checkProject.applyStatus==0}">
													<p class="form-control-static">申请已提交,请等待通知.</p>
												</c:if>
												<c:if test="${checkProject.applyStatus==1}">
													<p class="form-control-static">申请通过.</p>
												</c:if>
												<c:if test="${checkProject.applyStatus==2}">
													<p class="form-control-static">恭喜,验收通过.</p>
													
												</c:if>
												<c:if test="${checkProject.applyStatus==3}">
													<p class="form-control-static">被驳回.</p>
												</c:if>
											</div>
										</div>
										<c:if test="${checkProject.applyStatus==1}">
											<div class="form-group">
												<label class="col-sm-2 control-label">验收时间:</label>
												<div class="col-sm-10">
														<p class="form-control-static">${checkProject.checkTime}</p>
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">验收地点:</label>
												<div class="col-sm-10">
														<p class="form-control-static">${checkProject.checkAddress}</p>
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">验收要求:</label>
												<div class="col-sm-10">
														<p class="form-control-static">${checkProject.check_claim}</p>
												</div>
											</div>
										</c:if>
										<c:if test="${checkProject.applyStatus==3}">
											
											<div class="form-group">
												<label class="col-sm-2 control-label">驳回理由:</label>
												<div class="col-sm-10">
														<p class="form-control-static">${checkProject.failCheckInfo}</p>
												</div>
											</div>
										</c:if>
										<c:if test="${checkProject.applyStatus==2}">
											<div class="form-group">
												<label class="col-sm-2 control-label">评分:</label>
												<div class="col-sm-10" >
													<input type="hidden" id="pro_rate2" value="${checkProject.pro_rate}">
													<div id="result_rate"></div>
												</div>
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label">评语:</label>
												<div class="col-sm-10">
													<p class="form-control-static">${checkProject.pro_comment}</p>
												</div>
											</div>
											<div class="form-group">
												<c:if test="${checkProject.rebackRoom==1}">
													<label class="col-sm-5 control-label">
														<font color="red">
															项目结束，请小组所有成员尽早离开${projectInfo.project.roomId}房间
														</font>
													</label>
												</c:if>
											</div>		
										</c:if>
									</form>
					    		</c:if>
							</div>
							</div>
					    </div>
					    </div>
					  </div>
					</div> 
					</fieldset>
				</div>
				</div>
			</div>

	  <script>
	  var layer;
	  layui.use('layer', function(){
		  layer = layui.layer;
		  
		});
	//日期选择
	  layui.use('laydate', function(){
	    var laydate = layui.laydate;
	    
	    //执行一个laydate实例
	    laydate.render({
	      elem: '#the_date' //指定元素
	      ,min:getNowDay()
	      ,type: 'date'
	    });
	  });
	//日期选择
	  layui.use('laydate', function(){
	    var laydate = layui.laydate;
	    
	    //执行一个laydate实例
	    laydate.render({
	      elem: '#update_Finish_date' //指定元素
	      ,min:$("#finishTime").val()
	      ,type: 'date'
	    });
	  });
	
	  
	//获取当前时间(yyyy-MM-dd)
	  function getNowDay(){
	  	var now_day=new Date();
	  	var day=now_day.getDate();
	  	var month=now_day.getMonth()+1;
	  	var year=now_day.getFullYear();
	  	var now_day_String=year+"-"+month+"-"+day;
	  	console.log("now_day_String:"+now_day_String);
	  	return now_day_String;
	  }
	
	  var ps=$("#ps").val();
	  var projectStatus=$("#1_projectStatus").val();
	  var projectId=$("#1_projectId").val();
	  var groupId=$("#1_groupId").val();
	  var tasksStatus=$("#tasksStatus").val();// =1表示任务全部完成
	  var status;
	  console.log("ps:"+ps+",projectStatus:"+projectStatus+",projectId"+projectId+",groupId:"+groupId);
	 
	  //项目信息--
	  
	  
	  
	  
	  //--项目信息
	  
	  //申报项目--
	  var declareReportId;
	  /*
	  $("#submit_createPro").click(function(){
		if((ps==1&&projectStatus!=2)||(ps==2&&projectStatus!=0)){
			layer.alert("您有未完成的项目，请完成后再申报");
			return;
		}
		  $("#submit_ok").empty();
		  window.location.hash="";
		  if(declareReportId==null||declareReportId==""){
			  
			  $(function(){
				  window.location.hash="#upload_ok";
			  });
			  layer.alert("请先上传项目申报书");
		  }else{

			  $.ajax({
				  	url:"${pageContext.request.contextPath}/teacher/creatproject.do",
					type:"POST",
					data:$("#creatProject").serialize(),
					success:function(result){
						console.log("申报项目:"+result);
						if(result.code==100){
							location.reload();
							layer.alert("申报成功");
							//$("#submit_ok").append("<div></div>").addClass("alert alert-success").attr("role","alert").append("提交成功");
						}else if(result.code==200){
							layer.alert("申报失败");
						}
						
					}
			  });
		  }
		  
	  });
	  */
	  //判断项目是否在gitee上创建
	  $("#gitee_proName").blur(function(){
			var gitee_proName=$("#gitee_proName").val();
			$.ajax({
				type:"GET",
				url:"${pageContext.request.contextPath}/teacher/haveGiteeProName.do",
				data:{"gitee_proName":gitee_proName},
				success:function(result){
					if(result.code==100){
						//项目存在
						$("#gitee_full_name").val(result.extend.full_name);
						layer.msg("ok——"+result.extend.full_name, {icon: 1});
					}else{
						//
						$("#gitee_proName").val("");
						layer.msg(result.extend.msg, {icon: 5});
					}
				}
			});
	  });
	  
	  //添加项目小组成员
	  var analyseReportId;
	  var member_stuList=new Array();
	  $("#addStu_btn").click(function(){
		  var memberNum=$("#app_memberNum").val();
		  if(ps==0){
			  layer.alert("请先申报项目,在进行后续操作.");
			  return;
		  }else if(ps==1){
			  layer.alert("项目申报通过后才可进行此步骤！");
			  return;
		  }
		  else if(projectStatus>=2){
			  layer.alert("已经提交需求分析,请进行后续操作.");
			  return;
		  }
		  
		  var stuId=$("#addStu_input").val();
		  var b=true;
		  $.each(member_stuList,function(index,list_stuId){
			  if(list_stuId==stuId){
				  b=false;
			  }
		  });
		  var reg=/^\d{12}$/;//验证12位数字
		  if(!reg.test(stuId)){
			  layer.alert("请正确输入学号！");
		  }else if(!b){
			  layer.msg('该学生已添加', {icon: 5,time:1000});
		  }else{
			  
			  $.ajax({
				  	url:"${pageContext.request.contextPath}/student/getStuById.do",
					type:"GET",
					data:"stuId="+stuId,
					success:function(result){
						console.log(result);
						if(result.code==100){
							var stu=result.extend.member_stu;
							var length=member_stuList.length;
							console.log(length);
							if(length<memberNum){
								console.log(length+"----"+memberNum);
								//<li class="list-group-item">Cras justo odio</li>
								$("#memberList").append("<li></li>").addClass("list-group-item")
												.append("项目成员:&nbsp;&nbsp"+stu.stuName)
												.append("&nbsp;&nbsp{学号:&nbsp;&nbsp"+stu.stuId+",班级:&nbsp;&nbsp"+stu.stuClass+"}");
								member_stuList.push(stu.stuId);
							}else{
								layer.msg('项目最多有'+memberNum+'名成员', {icon: 2});
							}
							console.log(member_stuList);
							console.log(member_stuList.toString());
						}else if(result.code==200){
							layer.confirm('系统中未录入此学生信息，是否录入？', {
								  btn: ['录入','放弃'],time:5000//5秒后自动关闭
								}, function(){
									layer.open({
									      type: 2,
									      title: '录入学生信息',
									      maxmin: true,
									      shadeClose: true, //点击遮罩关闭层
									      area : ['800px' , '600px'],
									      content: '${pageContext.request.contextPath}/admin/addStuInfo.do'
									      
									    });
								}, function(){
								  layer.msg('放弃', {icon: 5});
								});
							
						}
						
					}
			  });
		  }
	  });
	  //提交成员数据
	  function addStu_fun(){
		  if(status>=3){
			  layer.alert("已完成此操作.");
			  return;
		  }else if(ps==0){
			  layer.alert("请先申报项目,在进行后续操作.");
			  return;
		  }else if(ps==1){
			  layer.alert("项目申报通过后才可进行此步骤！");
			  return;
		  }
		  else if(projectStatus>=2){
			  layer.alert("已经提交需求分析,请进行后续操作.");
			  return;
		  }else if(member_stuList.length==0){
			  layer.alert("未添加项目小组成员.");
			  return;
		  }
		  if(analyseReportId==null||analyseReportId==""){
			  layer.alert("请先上传需求分析报告");
			  return;
		  }
		  console.log(member_stuList);
		  var groupName=$("#add_groupName").val();
		  $.ajax({
			  	url:"${pageContext.request.contextPath}/student/insertMembers.do",
				type:"POST",
				traditional:true,
				data:{"member_stuList":member_stuList,"groupId":groupId,"groupName":groupName},
				success:function(result){
					console.log(result);
					if(result.code==100){
						layer.msg(result.extend.msg, {icon: 1});
						status=3;
					}else{
						layer.msg('添加失败', {icon: 5});
					}
				}
		  });
	  }
	  
	  //完成编码
	  	//任务分配
	  function distributeTask(taskId){
		  if(tasksStatus==1){
			  layer.msg('已完成编码', {icon: 5});
			  return;
		  }
		  console.log("taskId:"+taskId);
		  var members=[];
		  $("input[name='check2_stuId']:checked").each(function(i){
  				members[i]=$(this).val();
  			});
  			console.log(members);
  			console.log(members.length);
  			if(members.length<=0){
  				layer.msg('请选择学生', {icon: 5});
  				return;
  			}
			  $.ajax({
				  	url:"${pageContext.request.contextPath}/teacher/distributeTask.do",
					type:"GET",
					traditional:true,
					data:{"taskId":taskId,"stuId":members},
					success:function(result){
						console.log(result);
						if(result.code==100){
							layer.msg('任务分配成功', {icon: 1,time:2000,end:function(){
								location.reload();
							}});
						}
					}
			  });
		  		  
	  }
	  	//创建任务
	  $("#submit_createTask").click(function(){
		  
	  });
	  
	  //判断用户输入的分支是否存在	
	  $("#creatTask_form_branch").blur(function(){
		  var projectId=$("#creatTask_form_projectId").val();
		  var branch=$("#creatTask_form_branch").val();
		  if(branch==null||branch.trim()==""){
			  layer.msg('分支不能为空', {icon: 2});
		  }else if(branch=="master"){
			  layer.msg('不能为master分支,请创建其他分支！', {icon: 2})
		  }else{
			  $.get("${pageContext.request.contextPath}/git/isHaveBranch.do?projectId="+projectId+"&branch="+branch)
			  	.done(function(result){
			  		console.log(result);
			  		if(result.code==200){
			  			$("#creatTask_form_branch").val("");
			  			layer.msg(result.extend.msg, {icon: 2});
			  		}else{
			  			layer.msg('分支有效', {icon: 1});
			  		}
			  	});
		  }
		  
	  });
	  	
	  //保存新增任务信息
  		$("#saveTask_btn").click(function(){
  			if(tasksStatus==1){
  			  layer.msg('已完成编码', {icon: 5});
  			  return;
  		  	}
  			if($("#creatTask_form_input_taskFile").val()==null){
  				layer.msg('请先上传任务说明书', {icon: 5});
  				return;
  			}
  			console.log("新增数据:");
  			console.log($("#creatTask_form").serialize());
  			var members=[];
  			var data;
  			
  			var taskName=$("#creatTask_form_taskName").val();
	  		var branch=$("#creatTask_form_branch").val();
	  		console.log("taskName:"+taskName);
	  		console.log("branch:"+branch);
  			if(taskName==""){
	  			layer.msg('任务名称不能为空', {icon: 2});
	  			return;
	  		}else if(branch==""){
	  			layer.msg('分支不能为空', {icon: 2});
  				return;
	  		}
  			
  			if($("#check_null").is(":checked")){
  				console.log("check");
  				data={"branch":branch,"projectId":$("#creatTask_form_projectId").val(),"taskName":$("#creatTask_form_taskName").val(),"task_introduction":$("#creatTask_form_task_introduction").val(),"taskFile":$("#creatTask_form_input_taskFile").val()};
  			}else{
  				console.log("not check");
  				$("input[name='check_stuId']:checked").each(function(i){
  	  				members[i]=$(this).val();
  	  			});
  	  			console.log(members);
  	  			
  	  			data={"members":members,"branch":branch,"projectId":$("#creatTask_form_projectId").val(),"taskName":taskName,"task_introduction":$("#creatTask_form_task_introduction").val(),"taskFile":$("#creatTask_form_input_taskFile").val()};
  			}
  			console.log(data);
  			console.log("return");
  			$.ajax({
				  	url:"${pageContext.request.contextPath}/teacher/saveTask.do",
					type:"POST",
					traditional:true,
					data:data,
					success:function(result){
						if(result.code==100){
							$("#empAddModel").modal("hide");
							layer.msg('新增成功!', {icon: 1,time:2000,end:function(){
								location.reload();
							}});
							//$("#submit_ok").append("<div></div>").addClass("alert alert-success").attr("role","alert").append("提交成功");
						}else if(result.code==200){
							layer.msg('新增失败', {icon: 5});
						}
						
					}
			  });
	  	});  
	
	  //项目申请延期
	  $("#submit_update_finishTime").click(function(){
		  var update_finishTime=$("input[name='update_finishTime']").val();
		  console.log(update_finishTime);
		  if(update_finishTime==null||update_finishTime==""){
			  layer.msg('请选择修改时间', {icon: 0,time:1000});
			  return;
		  }
		  if(update_finishTime!=null){
			  $.ajax({
				  	url:"${pageContext.request.contextPath}/teacher/updateFinishTime.do",
					type:"POST",
					data:{"update_finishTime":update_finishTime,"projectId":projectId},
					success:function(result){
						if(result.code==100){
							
							layer.msg('修改成功,刷新页面查看新增数据', {icon: 1,time:1000});
							location.reload();
							//$("#submit_ok").append("<div></div>").addClass("alert alert-success").attr("role","alert").append("提交成功");
						}else if(result.code==200){
							layer.msg('修改失败', {icon: 5});
						}
						
					}
			  });
		  }
	  });
	  //验收
	  	// 评分
	  $("#result_rate").raty({
		path:'${pageContext.request.contextPath}/img/star',
  		readOnly: true,
  		score:$("#pro_rate2").val()
	});
	  
	  layui.use('element', function(){
		  var $ = layui.jquery
		  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

		});
	  layui.use(['form', 'layedit', 'laydate'], function(){
		  var form = layui.form
		  ,layer = layui.layer
		  ,layedit = layui.layedit;
		  
		});
	
	
	      //上传项目申报书--4
	     layui.use('upload', function(){
		  var $ = layui.jquery
		  ,upload = layui.upload;
		  //选完文件后不自动上传
		  upload.render({
		    elem: '#chooseFile'
		    ,url: '${pageContext.request.contextPath}/file/uploadProjectFile.do?type='+$("#chooseFile").attr("value")
		    ,traditional:true
		    ,field:'file'
		    ,accept:'file'
		    ,auto: false
		    ,multiple: false
		    ,bindAction:'#submit_createPro'
		    ,before: function(obj){ //obj参数包含的信息，跟 choose回调完全一致，可参见上文。
		    	
		    	var b=1;
		    	var projectName=$("#creatProject_projectName").val();
		    	var projectInfo=$("#creatProject_projectInfo").val();
		    	var finish=$("#the_date").val();
		    	console.log(projectName);console.log(projectInfo);console.log(finish);
		    	if(projectName==null||projectName==""){
		    		layer.msg("项目名称不能为空", {icon: 2});
		    		layer.closeAll('loading');
		    		b=0;
		    	}else if(projectInfo==null||projectInfo==""){
		    		layer.msg("项目描述不能为空", {icon: 2});
		    		layer.closeAll('loading');
		    		b=0;
		    	}else if(finish==null||finish==""){
		    		layer.msg("完成时间不能为空", {icon: 2});
		    		layer.closeAll('loading');
		    		b=0;
		    	}else{
		    		console.log("b:"+b);
			    	this.data={"re":b};
			    	layer.load(); //上传loading
		    	}
		    	
		    	
		    }
		    ,done: function(result){
		    	$("#declareReport").val(declareReportId);
		    	layer.closeAll('loading');
		    	console.log(result);
		    	if(result.code==100){

		    		$("#creatProject_declareReport").val(result.extend.fileId);
		    		console.log($("#creatProject").serialize());
		    		$.ajax({
					  	url:"${pageContext.request.contextPath}/teacher/creatproject.do",
						type:"POST",
						data:$("#creatProject").serialize(),
						success:function(result){
							console.log("创建成功！");
								layer.msg('申报成功!', {icon: 1,time:2000,end:function(){
									location.reload();
								}});
						}
				  });
		    		
		    	}else if(result.code==200){
		    		layer.msg(result.extend.errorMsg, {icon: 2});
		    	}
		    	
		    }
		  });
		  
		});
	    //上传需求分析报告--5
	      layui.use('upload', function(){
	    	  
			  var $ = layui.jquery
			  ,upload = layui.upload;
			  //选完文件后不自动上传
			  upload.render({
			    elem: '#chooseFile1'
			    ,url: '${pageContext.request.contextPath}/file/uploadProjectFile.do?type='+$("#chooseFile1").attr("value")+'&projectId='+projectId
			    ,traditional:true
			    ,field:'file'
			    ,accept:'file'
			    ,auto: false
			    ,multiple: false
			    ,bindAction:'#submitMembers'
			    ,before: function(obj){
			    	console.log("before");
			    	var groupName=$("#add_groupName").val();
			    	var gitee_proName=$("#gitee_proName").val();
			    	var b=1;
			    	if(groupName==null||groupName==""){
			    		layer.msg("项目名称不能为空", {icon: 2});
			    		b=0;
			    	}else if(gitee_proName==null||gitee_proName==""){
			    		layer.msg("gitee上的项目名称必填", {icon: 2});
			    		b=0;
			    	}
			    	else if(member_stuList==null||member_stuList.length<1){
			    		console.log(member_stuList.length);
			    		layer.msg("请添加项目小组成员", {icon: 2});
			    		b=0;
			    	}
			    	this.data={"re":b};
			    }
			    ,done: function(result){
			    /*	$("#upload_ok").append("<div></div>").addClass("col-md-3 col-md-offset-1")
			    		.append($("<div></div>").addClass("alert alert-success").attr("role","alert").append("上传成功"));
			    */	
				    console.log("done");
				    console.log(result);
			    	if(result.code==100){
					    analyseReportId=result.extend.fileId;
					    var groupName=$("#add_groupName").val();
					    var gitee_proName=$("#gitee_proName").val();
					    var gitee_full_name=$("#gitee_full_name").val();
						  $.ajax({
							  	url:"${pageContext.request.contextPath}/student/insertMembers.do",
								type:"POST",
								traditional:true,
								data:{"member_stuList":member_stuList,"groupId":groupId,"groupName":groupName,"gitee_proName":gitee_proName,"gitee_full_name":gitee_full_name},
								success:function(result){
									console.log(result);
									if(result.code==100){
										layer.msg(result.extend.msg, {icon: 1,time:2000,end:function(){
											location.reload();
										}});
										status=3;
									}else{
										layer.msg('添加失败', {icon: 5});
									}
								}
						  });
			    	}else if(result.code==200){
			    		layer.msg(result.extend.errorMsg, {icon: 2});
			    	}
			    	
			    }
			  });
	      });
	    
	    //上传任务说明书--7
	      layui.use('upload', function(){
			  var $ = layui.jquery
			  ,upload = layui.upload;
			  //选完文件后不自动上传
			  upload.render({
			    elem: '#chooseFile7'
			    ,url: '${pageContext.request.contextPath}/file/uploadProjectFile.do?type='+$("#chooseFile7").attr("value")+'&projectId='+projectId
			    ,traditional:true
			    ,field:'file'
			    ,accept:'file'
			    ,auto: false
			    ,multiple: false
			    ,bindAction:'#upload7'
			    ,done: function(result){

				    analyseReportId=result.extend.fileId;
				    	if(result.code==100){
						    layer.msg('上传成功', {icon: 1,time:2000});
						    $("#div_upload_taskFile").append(
						    		$("<div></div>").addClass("alert alert-success").attr("style","margin-top: 5px;")
						    			.attr("role","alert").append($("<strong></strong>").append(result.extend.fileName))
						    			.append(",上传成功."))
						    		.append($("<input></input>").attr("type","hidden").attr("id","creatTask_form_input_taskFile").attr("name","taskFile").attr("value",result.extend.fileId));
						      console.log("result"+result);
						      console.log(result.extend.fileId);
						      console.log(result.extend.fileName);
				    	}else if(result.code==200){
				    		console.log($("#chooseFile7").attr("value"));
				    		layer.alert("上传失败!");
				    	}
			    	
			    }
			  });
	      });
	    //上传项目报告--6	div_upload_projectReport
	    layui.use('upload', function(){
			  var $ = layui.jquery
			  ,upload = layui.upload;
			  //选完文件后不自动上传
			  upload.render({
			    elem: '#chooseFile6'
			    ,url: '${pageContext.request.contextPath}/file/uploadProjectFile.do?type='+$("#chooseFile6").attr("value")+'&projectId='+projectId
			    ,traditional:true
			    ,field:'file'
			    ,accept:'file'
			    ,auto: false
			    ,multiple: false
			    ,bindAction:'#upload6'
			    ,done: function(result){
			    	console.log("result:"+result);
				    analyseReportId=result.extend.fileId;
				    	if(result.code==100){
				    		$.ajax({
							  	url:"${pageContext.request.contextPath}/teacher/applyCheck.do",
								type:"POST",
								data:"projectId="+projectId,
								success:function(result){
									
									if(result.code==100){
										
										layer.msg('申请成功', {icon: 1,time:2000,end:function(){
											location.reload();
										}});
									}else if(result.code==200){
										layer.msg('申请失败', {icon: 5,time:2000,end:function(){
											location.reload();
										}});
									}
									
								}
						  });
						    
						      console.log("result"+result);
						      console.log(result.extend.fileId);
						      console.log(result.extend.fileName);
				    	}else if(result.code==200){
				    		console.log($("#chooseFile7").attr("value"));
				    		layer.msg(result.extend.errorMsg, {icon: 5});
				    	}
			    	
			    }
			  });
	      });
	  </script>
	</body>
</html>